package com.harsom.camerademo

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.yanzhenjie.permission.AndPermission
import com.yanzhenjie.permission.Permission
import com.yuri.activity.lib.ActivityUtil
import com.yuri.xlog.XLog
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        XLog.initialize().setAppTag("Camera")

        button_camera.setOnClickListener {
            ActivityUtil.with(this)
                    .activity(CameraActivity::class.java)
                    .start()
        }

        button_test.setOnClickListener {
            ActivityUtil.with(this)
                    .activity(VideoTestActivity::class.java)
                    .start()
        }


        AndPermission.with(this)
                .runtime()
                .permission(Permission.Group.STORAGE, Permission.Group.CAMERA, Permission.Group.MICROPHONE)
                .start()
    }
}
